<template>
    <div>
        ChildCom - {{ firstName + lastName }}
    </div>
</template>

<script setup>
import { ref } from 'vue'
const firstName = ref('二') 
const lastName = ref('桥')
const setUsername = () => {
    firstName.value = '拾'
    lastName.value = '涯'
}

// 暴露属性,外部才可以通过ref进行引用获取
defineExpose({ firstName, lastName, setUsername })
</script>

<style lang="scss" scoped>
</style>